const express = require('express')
const { baseURL } = require('../config')
const router = express.Router()
const Detail = require('../models/Detail')

/**
 * 查询商品信息
 */
router.get('/', function(req, res, next) {
  const { id } = req.query
  Detail
    .find({id}, {_id: false, __v: false})
    .then(data => {
      const [detail] = data
      res.json({
        code: 200,
        data: {
          detail
        }
      })
    })
})

module.exports = router
